//
//  BTEUploadTool.swift
//  BTE
//
//  Created by Mike Zhang on 2025/8/5.
//

import UIKit
import Alamofire
import SmartCodable





enum BTEProductTool_API: SERVER_NET_TYPE {
    
    case unpernicious([String:String])
    case sacculated([String:String])
    case penalosa([String:String])
    case subsale([String:String])
    
    case decompensates
    
    case subvii([String:Any])
    case undonated([String:String])
    
    // 信息
    case palaeoglaciology([String:String])
    case vasovagal([String:String])
    
    case girls([String:String])
    case leucoxene([String:String])
    
    case donet([String:String])
    case chandelled([String:String])
    
    case belaud([String:String])
    case compute([String:String])
    
    case manificum([String:String])
    
    var ROOT: String {
        return ROOT_PATH
    }
    
    
    var PATH: String {
        switch self {
        case .unpernicious:
            return "/Blaugas/unpernicious"
        case .sacculated:
            return "/Blaugas/sacculated"
        case .penalosa:
            return "/Blaugas/penalosa"
        case .subsale:
            return "/Blaugas/subsale"
        case .subvii:
            return "/Blaugas/subvii"
        case .undonated:
            return "/Blaugas/undonated"
        case .decompensates:
            return "/Blaugas/decompensates"
        case .palaeoglaciology(_):
            return "/Blaugas/palaeoglaciology"
        case .vasovagal(_):
            return "/Blaugas/vasovagal"
        case .girls(_):
            return "/Blaugas/girls"
        case .leucoxene(_):
            return "/Blaugas/leucoxene"
        case .donet(_):
            return "/Blaugas/donet"
        case .chandelled(_):
            return "/Blaugas/chandelled"
        case .belaud(_):
            return "/Blaugas/belaud"
        case .compute(_):
            return "/Blaugas/compute"
        case .manificum(_):
            return "/Blaugas/manificum"
        }
    }
    
    
    var METHOD: SERVER_NET_F {
        switch self {
        case .unpernicious:
            return .POST
        case .sacculated:
            return .POST
        case .penalosa:
            return .POST
        case .subsale:
            return .POST
        case .subvii:
            return .POST
        case .undonated:
            return .POST
        case .decompensates:
            return .GET
        case .palaeoglaciology(_):
            return .POST
        case .vasovagal(_):
            return .POST
        case .girls(_):
            return .POST
        case .leucoxene(_):
            return .POST
        case .donet(_):
            return .POST
        case .chandelled(_):
            return .POST
        case .belaud(_):
            return .POST
        case .compute(_):
            return .POST
        case .manificum(_):
            return .POST
        }
    }
    
    
    var TASK: SERVER_TASK {
        switch self {
        case .unpernicious(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .sacculated(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .penalosa(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .subsale(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .subvii(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .undonated(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .decompensates:
            return .requestPlain
        case .palaeoglaciology(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .vasovagal(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .girls(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .leucoxene(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .donet(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .chandelled(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .belaud(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .compute(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        case .manificum(let idc):
            return .requestParameters(parameters: idc, encoding: URLEncoding.httpBody)
        }
    }
    
    
    var HEADER: [String : String]? {
        return nil
    }
    
}




class BTEProductToolNetServer: BTEServiceTool<BTEProductTool_API> {
    
    func decompensates(completion: @escaping (Result<NetBaseModel<[BTECarneolfejubdaderesswgeNetModel]>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.decompensates, resultClass: NetBaseModel<[BTECarneolfejubdaderesswgeNetModel]>.self) { result in
            completion(result)
        }
    }
    
 
    func Carneol(data:[String:String],completion: @escaping (Result<NetBaseModel<BTECarneolNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.unpernicious(data), resultClass: NetBaseModel<BTECarneolNetModel>.self) { result in
            completion(result)
        }
    }
    
    func sacculated(data:[String:String],completion: @escaping (Result<NetBaseModel<BTEProductNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.sacculated(data), resultClass: NetBaseModel<BTEProductNetModel>.self) { result in
            completion(result)
        }
    }
    
    func penalosa(data:[String:String],completion: @escaping (Result<NetBaseModel<BTEProductpenalosaNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.penalosa(data), resultClass: NetBaseModel<BTEProductpenalosaNetModel>.self) { result in
            completion(result)
        }
    }
    
    func subsale(data:[String:String],completion: @escaping (Result<NetBaseModel<BTECarneolfewgeNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.subsale(data), resultClass: NetBaseModel<BTECarneolfewgeNetModel>.self) { result in
            completion(result)
        }
    }
    
    func subvii(data:[String:Any],completion: @escaping (Result<NetBaseModel<BTECarneolfejubilarwgeNetModel>?, NetError>) -> Void) {
        uploadPic(target: BTEProductTool_API.subvii(data), resultClass: NetBaseModel<BTECarneolfejubilarwgeNetModel>.self) { result in
            completion(result)
        }
    }
    
    func undonated(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.undonated(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func palaeoglaciology(data:[String:String],completion: @escaping (Result<NetBaseModel<BTECarnepalaeoglaciologyNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.palaeoglaciology(data), resultClass: NetBaseModel<BTECarnepalaeoglaciologyNetModel>.self) { result in
            completion(result)
        }
    }
    
    func vasovagal(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.vasovagal(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func girls(data:[String:String],completion: @escaping (Result<NetBaseModel<BTECarnepalaeoglaciologyNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.girls(data), resultClass: NetBaseModel<BTECarnepalaeoglaciologyNetModel>.self) { result in
            completion(result)
        }
    }
    
    func leucoxene(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.leucoxene(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func donet(data:[String:String],completion: @escaping (Result<NetBaseModel<BTECarnepalaeoglaciologyNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.donet(data), resultClass: NetBaseModel<BTECarnepalaeoglaciologyNetModel>.self) { result in
            completion(result)
        }
    }
    
    func chandelled(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.chandelled(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func belaud(data:[String:String],completion: @escaping (Result<NetBaseModel<BTECarnepalaeoglacfewfewiologyNetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.belaud(data), resultClass: NetBaseModel<BTECarnepalaeoglacfewfewiologyNetModel>.self) { result in
            completion(result)
        }
    }
    
    func compute(data:[String:String],completion: @escaping (Result<NetBaseModel<BaseEmptyModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.compute(data), resultClass: NetBaseModel<BaseEmptyModel>.self) { result in
            completion(result)
        }
    }
    
    func manificum(data:[String:String],completion: @escaping (Result<NetBaseModel<BTECarnepalaeoglaciologyNfewetModel>?, NetError>) -> Void) {
        fetchData(target: BTEProductTool_API.manificum(data), resultClass: NetBaseModel<BTECarnepalaeoglaciologyNfewetModel>.self) { result in
            completion(result)
        }
    }
}

class BTECarnepalaeoglaciologyNfewetModel: SmartCodable {
    var vyner: String?
    required init(){}
}


class BTECarneolfejubdaderesswgeNetModel: SmartCodable {
    var remoted: String? // id
    var geothermally: String? // code
    var manificum: String? // name
    var flinter: [BTECarneolfejubdaderesswgeNetModel]?
    var choised: Bool = false
    required init(){}
}

class BTECarnepalaeoglaciologyNetModel: SmartCodable {
    var brokers: [BTECarnepalaeoglacioewelogyNetModel]?
    required init(){}
}

class BTECarnepalaeoglacfewfewiologyNetModel: SmartCodable {
    var gena: [BTECarnepalaeoglafewfwcioewelogyNetModel]?
    required init(){}
}

class BTECarnepalaeoglafewfwcioewelogyNetModel: SmartCodable {
    var anhydridization: String?
    var manificum: String?
    var meedful: String?
    var aftermath: String?
    var cauf: String?
    var vain: String?
    var aeromechanics: String?
    var concludent: String?
    var panderism: [BTECarnepalaepanderismaciologyNetModel]?
    required init(){}
}


class BTECarnepalaeoglacioewelogyNetModel: SmartCodable {
    var archipallium: String?
    var aftermath: String?
    var unobstruct: String?
    var geothermally: String?
    var nondifferentiable: String?
    var diapase: String?
    var chandelled: String?
    var safen: String?
    var tactile: String?
    var dikegrave: String?
    var tripylaean: String?
    var kryokonite: String?
    var horsecraft: String?
    var panderism: [BTECarnepalaepanderismaciologyNetModel]?
    required init(){}
}

class BTECarnepalaepanderismaciologyNetModel: SmartCodable {
    var manificum: String?
    var dikegrave: String?
    var choised: Bool = false
    required init(){}
}


class BTECarneolfejubilarwgeNetModel: SmartCodable {
    var chokier:String?
    var jubilar:[BTECarneolfeweejubilarwgeNetModel]?
    required init(){}
}

class BTECarneolfeweejubilarwgeNetModel: SmartCodable {
    var danknesses:String?
    var questers:String?
    var geothermally:String?
    required init(){}
}



class BTECarneolfewgeNetModel: SmartCodable {
    var tiniest:BTECarneolfetiniestwgeNetModel?
    required init(){}
}

class BTECarneolfetiniestwgeNetModel: SmartCodable {
    var brianna: String?
    var alluviums: String?
    var katakinetomer: String?
    var bakerly: String?
    var fermis: String?
    required init(){}
}


class BTECarneolNetModel: SmartCodable {
    var vyner:String?
    required init(){}
}

class BTEProductNetModel: SmartCodable {
    var nonchurchgoing: BTEProducdfewfewtNetModel?
    var ebon: [BTEProductpeeebonbloidNetModel]?
    var earworms: BTEProductpeearwormsNetModel?
    var antitabloid: BTEProductpeearantitabloidNetModel?
    required init(){}
}

class BTEProducdfewfewtNetModel: SmartCodable {
    var archipallium: String?
    var cuspid: String?
    var butyrins: String?
    var bakeboard: String?
    var druggists: String?
    var nonrhythmical: String?
    var unpoetical: String?
    var pavise: String?
    var allergin: String?
    var neurasthenias: String?
    var foreswears: String?
    var unhanged: String?

 
    var itching:BTEProductpenalosaitchingNetModel?
    required init(){}
}



class BTEProductpeearwormsNetModel: SmartCodable {
    var aftermath:String?
    var plectra:String?
    required init(){}
}

class BTEProductpeearantitabloidNetModel: SmartCodable {
    var subgraphs:String?
    var vyner:String?
    var dikegrave:String?
    var aftermath:String?
    required init(){}
}

class BTEProductpeeebonbloidNetModel: SmartCodable {
    var aftermath: String?
    var acceptable: String?
    var chandelled: String?
    var unobstruct: String?
    var subgraphs: String?
    var dikegrave: String?
    var vyner: String?
    var safen: String?
    var aesir: String?
    var diapase: String?
    var circumfusile: String?
    var scabbily: String?
    
    required init(){}
}

class BTEProductpenalosaitchingNetModel: SmartCodable {
    var raffling:BTEProductpedulleringNetModel?
    var duller:BTEProductpedulleringNetModel?
    required init(){}
}

class BTEProductpedulleringNetModel: SmartCodable {
    var aftermath:String?
    var subdichotomously:String?
    required init(){}
}


class BTEProductpenalosaNetModel: SmartCodable {
    var vincents:[BTEProductpenalosavincentsNetModel]?
    required init(){}
}

class BTEProductpenalosavincentsNetModel: SmartCodable {
    var unhanged: String?
    var armorel: String?
    var nondepartmentally: String?
    var cuspid: String?
    var butyrins: String?
    var bemuffle: String?
    var gastrovascular: String?
    var superial: String?
    var allergin: String?
    var tigelle: String?
    var apothegmatical: String?
    var appall: String?
    var lina: String?
    var unremembered: String?
    var priggishly: String?
    var estriate: String?
    var susceptive: String?
    var unpoetical: String?
    var flinter: [BTEProductListpenalosavincentsNetModel]?
    var catalyses: String?
    var scallom: String?
    required init(){}
}


class BTEProductListpenalosavincentsNetModel: SmartCodable {
    var aftermath: String?
    var celtophobe: String?
    required init(){}
}

